import Mock from 'mockjs'
//生成模拟数据
const obj = Mock.mock({
  'list|5': [
    {
      id: '@id',
      name: '@cname',
      title: '@ctitle(6,10)'
    }
  ]
})

export default [
  {
    url: '/api/getAppInfo',
    method: 'get',
    response: () => {
      return {
        code: 200,
        title: 'mock请求测试',
        message: '请求成功'
      }
    }
  },
  {
    url: '/api/getUserInfo',
    method: 'get',
    response: () => {
      return {
        code: 200,
        data: {
          name: 'ccOne-1',
          age: 18,
          sex: '男',
          address: '北京市',
          email: 'mock@mock.com',
          birthday: '1995-01-01',
          token: Mock.Random.guid()
        },
        message: '请求成功'
      }
    }
  },
  {
    url: '/api/user',
    type: 'get',
    response: () => {
      return {
        code: 200,
        data: obj.list,
        message: '请求成功'
      }
    }
  }
]
